<!--
 * @Description: 
 * @Date: 2020-12-31 16:06:41
 * @LastEditors: lother
 * @LastEditTime: 2020-12-31 16:40:38
 * @FilePath: \AccounOpening-WEB\src\components\password\index.vue
-->
<!--
 * @Description: 
 * @Date: 2020-12-31 16:06:41
 * @LastEditors: lother
 * @LastEditTime: 2020-12-31 16:27:11
 * @FilePath: \AccounOpening-WEB\src\components\password\index.vue
-->
<template>
     <el-input
            :value="value"
            :placeholder="placeholder"
            @input="inputValue"
            :type="show?'text':'password'"
            class="pass-word"
          >
          <template slot="suffix">
               <svg-icon :icon-class="show?'icon-zhengyan':'icon-yanjingbiyan'" style="height: 100%;width: 20px;" @click="show = !show " ></svg-icon>
          </template>
        </el-input>
</template>
<script>
export default {
    props:{
        value:{
            type:[String],
            default:()=>''
        },
        placeholder:{
            type:String,
            default:()=>''
        }
    },
    data() {
        return {
            val:"",
            show:false,
        }
    },
    methods:{
        inputValue(val){
            this.$emit('input',val)
        }
    }
}
</script>
<style lang="scss" scoped>
    .pass-word{
        >>>.el-input__suffix{
            cursor: pointer; 
        }
    }
</style>